/* 应用核心样式 - 包括加载界面、设置面板和其他核心UI元素 */

/* 加载界面样式 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
    padding: 2rem;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
}

.loading-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    animation: pulse 1.5s infinite;
}

.loading-content h1 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.loading-progress {
    width: 100%;
}

.progress-bar {
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 错误界面样式 */
.error-content {
    text-align: center;
    color: var(--text-primary);
    padding: 2rem;
    border-radius: 8px;
    background-color: var(--bg-secondary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 90%;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--error-color);
}

.error-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.error-content p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.retry-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
}

.retry-btn:hover {
    background-color: var(--primary-color-dark);
}

/* 设置面板样式 */
#settings-panel {
    position: fixed;
    top: 60px;
    right: -400px;
    width: 350px;
    height: calc(100vh - 60px);
    background-color: var(--bg-secondary);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#settings-panel.visible {
    right: 0;
}

.settings-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.settings-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
}

.settings-close:hover {
    color: var(--text-primary);
}

.settings-content {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.settings-group {
    margin-bottom: 1.5rem;
}

.settings-group-header {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.settings-item {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-label {
    color: var(--text-primary);
}

/* 开关按钮样式 */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    transition: .4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* 下拉选择样式 */
.settings-select {
    padding: 0.5rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 120px;
}

/* 数字输入样式 */
.settings-number {
    padding: 0.5rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 80px;
    text-align: center;
}

/* 保存按钮 */
.settings-actions {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

.settings-save {
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.settings-save:hover {
    background-color: var(--primary-color-dark);
}

.settings-save:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* 面板样式 */
.panel {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 1rem;
}

.panel-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.panel-content {
    padding: 1rem;
}

/* 卡片样式 */
.card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.card-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.card-content {
    margin-bottom: 0.75rem;
}

.card-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-status {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.card-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

/* 状态指示器样式 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-indicator.online {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success-color);
}

.status-indicator.offline {
    background-color: rgba(189, 195, 199, 0.1);
    color: var(--text-secondary);
}

.status-indicator.warning {
    background-color: rgba(241, 196, 15, 0.1);
    color: var(--warning-color);
}

.status-indicator.error {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--error-color);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-dot.online {
    background-color: var(--success-color);
}

.status-dot.offline {
    background-color: var(--text-secondary);
}

.status-dot.warning {
    background-color: var(--warning-color);
}

.status-dot.error {
    background-color: var(--error-color);
}

/* 统计卡片样式 */
.stats-card {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    margin-right: 1rem;
}

.stats-content {
    flex: 1;
}

.stats-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stats-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stats-change {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
}

.stats-change.positive {
    color: var(--success-color);
}

.stats-change.negative {
    color: var(--error-color);
}

.stats-change.neutral {
    color: var(--text-secondary);
}

/* 动画 */
@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    visibility: hidden;
    width: 120px;
    background-color: var(--tooltip-bg);
    color: var(--tooltip-text);
    text-align: center;
    border-radius: 4px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1001;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--tooltip-bg) transparent transparent transparent;
}

.tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #settings-panel {
        width: 100%;
        right: -100%;
    }
    
    .stats-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .panel-actions {
        margin-top: 0.5rem;
        width: 100%;
        justify-content: flex-end;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 暗色模式适配 */
[data-theme="dark"] .loading-content,
[data-theme="dark"] .error-content {
    background-color: var(--bg-secondary-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #settings-panel {
    background-color: var(--bg-secondary-dark);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .stats-card {
    background-color: var(--bg-secondary-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}